var e = getApp();

Page({
    data: {
        language: "",
        store: {
            name: "",
            thumb: ""
        },
        income: {
            money_total: 0,
            sure_withdraw_money: 0
        },
        store_set: {
            is_cash_pay: "",
            is_open_cashier: "",
            is_write_information: ""
        },
        title: "",
        vedioSrc: "",
        storeManageOpen: !0
    },
    onLoad: function(e) {
        this.checkrouter(), this.getStoreInfo();
    },
    checkrouter: function() {
        var e = this;
        try {
            !function() {
                for (var t = wx.getStorageSync("yz_basic_info"), a = t.popularize_page.mini.vue_route, o = 0; o < a.length; o++) "cashier" == a[o] && (console.log(t.popularize_page.mini.mini_url + "跳转的路径"), 
                e.setData({
                    storeManageOpen: !1
                }), t.popularize_page.mini.mini_url ? wx.showToast({
                    title: "未开启推广权限",
                    duration: 2e3,
                    icon: "none",
                    success: function() {
                        setTimeout(function() {
                            wx.redirectTo({
                                url: t.popularize_page.mini.mini_url
                            });
                        }, 1e3);
                    }
                }) : wx.showModal({
                    content: "未开启推广权限",
                    showCancel: !1,
                    success: function(e) {
                        e.confirm && wx.navigateBack({
                            delta: 1
                        });
                    }
                }));
            }();
        } catch (e) {
            console.log(e);
        }
    },
    onReady: function() {
        var e = wx.getStorageSync("langIndex");
        this.setData({
            language: e.en
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getStoreInfo: function() {
        var t = this, a = e.getNetAddresss("plugin.store-cashier.frontend.cashier.center.index");
        e._getNetWork({
            url: a,
            success: function(e) {
                var a = e.data;
                1 == a.result ? t.setData({
                    store: a.data.store,
                    income: a.data.income,
                    store_set: a.data.store_set
                }) : wx.showToast({
                    icon: "none",
                    title: a.msg,
                    duration: 1500
                });
            },
            fail: function(e) {
                console.log(e);
            }
        });
    },
    gowithdrawal: function() {
        wx.navigateTo({
            url: "/packageA/member/withdrawal/withdrawal"
        });
    },
    toPage: function(e) {
        var t = e.currentTarget.dataset.message;
        "cashierOrderlist" !== t ? "presentationRecord" !== t ? "income_breakdown" !== t ? wx.navigateTo({
            url: "/packageC/cashier/" + t + "/" + t
        }) : wx.navigateTo({
            url: "/packageC/cashier/cashierIncome/cashierIncome"
        }) : wx.navigateTo({
            url: "/packageA/member/presentationRecord_v2/presentationRecord_v2?i=" + this.data.store.store_id + "&type=store_cashier"
        }) : wx.navigateTo({
            url: "/packageA/member/myOrder_v2/myOrder_v2?status=0&orderType=cashier"
        });
    }
});